1. Field of the Invention
The present invention is directed to the field of porting computer code. It is more particularly directed to optimizing serialization code when porting high-performance applications to IBM S/390 UNIX System Services from other UNIX systems.
2. Description of the Background Art
Typically complex computer applications, such as a database, are ported to a variety of computer systems. The porting process often includes special changes to the application to enable efficient and complete operation of the application on different computer systems. Serialized code operations are a significant factor in the overall performance of a complex computer application. High-performance computer applications, such as a database, may require serialization of the code used to access data to ensure that certain data access operations are performed before others are subsequently performed. Such serialization may not be supported by efficient techniques on the target system. A “target computer system” as used herein refers to a computer system environment consisting of one or more specific programming languages, such as the C programming language, and the application programming interfaces (APIs) available in the programming languages. Therefore, changes to serialization operations may be made during the porting of an application to ensure efficient operation of the application on the target computer system. Such a target computer system may include the products sold under the trademarks IBM S/390® that includes the IBM OS/390® (OS/390) operating system, the z/OS operating system, and the UNIX System Services for the IBM OS/390® (OS/390 UNIX).
On systems sold under the trademark UNIX, serialization is typically implemented using C program run-time APIs such as pthread_mutex_lock, pthread_mutex_trylock, and pthread_mutex_unlock. These mutex serialized operations and other such C program run-time APIs will be referred to herein as “pthread_mutex calls.” The OS/390 UNIX provides a “Compare and Swap” C Run-Time Library API that requires less computer instructions to execute than standard UNIX run-time APIs, such as the pthread_mutex calls, and which may sometimes be used in their place. It will be understood that the terms “Compare and Swap C Run-Time Library API” and “Compare and Swap API” will be used interchangeably herein. Under certain circumstances, the Compare and Swap API serialized operations may perform more than one hundred times faster during computer program execution than the standard pthread_mutex calls. It would be advantageous to be able to determine when serialization operations on the OS/390 UNIX will perform faster by using the Compare and Swap API instead of the standard pthread_mutex calls. Therefore when appropriate, it would be advantageous if serialized operations on the OS/390 UNIX system could take advantage of the highly efficient Compare and Swap API.
From the foregoing it will be apparent that there is still a need to improve the techniques of serialization on the OS/390 UNIX systems over the past. More particularly, existing systems have not been able to determine when taking advantage of the Compare and Swap API of the OS/390 UNIX would improve performance of serialization code that has been ported from other computer systems to the OS/390 UNIX target computer system.